package integration.properties.message;

import integration.properties.message.impl.CsvMessageFormatImpl;
import integration.properties.message.impl.JsonMessageFormatImpl;
import integration.properties.message.impl.XmlMessageFormatImpl;

public class MessageFormatFactory {

    public static MessageFormat createMessageFormat (String format) {
        if ("csv".equalsIgnoreCase(format)) return new CsvMessageFormatImpl();
        else if ("json".equalsIgnoreCase(format)) return new JsonMessageFormatImpl();
        else if ("xml".equalsIgnoreCase(format)) return new XmlMessageFormatImpl();
        else throw new IllegalArgumentException("Invalid message format argument: " + format);
    }
}
